<?php
define("IS_MAIN", true);
require "./ajax/modules/set.php";
function error()
{
    echo "安装错误";
    exit;
}
$conn = mysqli_connect($app["sql"]["host"], $app["sql"]["user"], $app["sql"]["password"], $app["sql"]["dbname"], $app["sql"]["port"]);
if ($conn->connect_errno) {
    error();
}
if(!($conn->query("create table users (name longtext,id longtext,email longtext,password longtext, op text)charset=utf8;") &&
$conn->query("create table code (time longtext, code longtext, id longtext)charset=utf8;")&&
$conn->query("insert into users (id,name,email,password,op) values ('1','admin','','admin123','true');"))) {
    error();
}
echo "安装成功，请立即删除此文件！！！";